<?php
session_start();
require_once("./config/include.inc.php");
$sql = "";

//获取form值
$doFlag = $_POST["doFlag"];
if($doFlag == "addTask"){
	//新加任务
	$taskContent = $_POST["taskContent"];
	$taskLevel = $_POST["taskLevel"];
	$sql = "INSERT INTO tasks (content,level,status) VALUES ('$taskContent','$taskLevel',1)";
	$db->Execute($sql);
}else if($doFlag == "addProcess"){
	//任务新进展
	$taskId = $_POST["taskId"];
	$processStr = $_POST["process_".$taskId];
	$sql = "insert into taskprocess(task_id,task_process) values ($taskId,'$processStr')";
	$db->Execute($sql);
}else if($doFlag == "doComplete"){
	//任务完成
	$taskId = $_POST["taskId"];
	$sql = "update tasks set status=2 where id=".$taskId;
	$db->Execute($sql);
	$processStr = "完成时间";
	$sql = "insert into taskprocess(task_id,task_process) values ($taskId,'$processStr')";
	$db->Execute($sql);
}else if($doFlag == "doDelete"){
	//删除任务
	$taskId = $_POST["taskId"];
	$sql = "update tasks set status=3 where id=".$taskId;
	$db->Execute($sql);
	$processStr = "删除时间";
	$sql = "insert into taskprocess(task_id,task_process) values ($taskId,'$processStr')";
	$db->Execute($sql);
}else if($doFlag == "order_H"){
	//加订单 Hiteclaser	
	$order_H = $_POST["order_H"];
	$sql = "select * from orders where orders_id=".$order_H;
	$result_H = $db_H->Execute($sql);	
	if(!$result_H->EOF){
		$str = "H";
		$str = $str.$result_H->fields['orders_id'];	
		$str = $str.', ';
		$str = $str.$result_H->fields['customers_name'];	
		$str = $str."<br>";
		$sql = "select * from orders_products where orders_id=".$order_H;
		$result_H_products = $db_H->Execute($sql);
		while (!$result_H_products->EOF) {
				$str = $str.$result_H_products->fields['products_quantity']." x ".$result_H_products->fields['products_name']."    ". floor($result_H_products->fields['products_price'])."円";
				$sql_attributes = "select * from orders_products_attributes  where orders_id=".$order_H."  and orders_products_id=".$result_H_products->fields['orders_products_id'];
				$result_H_products_attributes = $db_H->Execute($sql_attributes);
				while (!$result_H_products_attributes->EOF) {
					$str = $str."(".$result_H_products_attributes->fields['products_options_values']."+".floor($result_H_products_attributes->fields['options_values_price'])."円)";
					$result_H_products_attributes->MoveNext();	
				}
				$str = $str.";<br>";
				$result_H_products->MoveNext();	
		}
		echo "***************************************<br>".$str."***************************************<br>";
		$taskContent = $str;
		$taskLevel = 1;
		$sql = "INSERT INTO tasks (content,level,status) VALUES ('$taskContent','$taskLevel',1)";
		$db->Execute($sql);		
	}else{
		echo "***************************************<br>没这个订单ID：".$order_H."<br>***************************************<br>";
	}

}else if($doFlag == "order_HLD"){
	//加订单 Laser-door	
	$order_HLD = $_POST["order_HLD"];
	$sql = "select * from orders where orders_id=".$order_HLD;
	$result_HLD = $db_HLD->Execute($sql);	
	if(!$result_HLD->EOF){
		$str = "HLD";
		$str = $str.$result_HLD->fields['orders_id'];	
		$str = $str.', ';
		$str = $str.$result_HLD->fields['customers_name'];	
		$str = $str."<br>";
		$sql = "select * from orders_products where orders_id=".$order_HLD;
		$result_HLD_products = $db_HLD->Execute($sql);
		while (!$result_HLD_products->EOF) {
				$str = $str.$result_HLD_products->fields['products_quantity']." x ".$result_HLD_products->fields['products_name']."    ". floor($result_HLD_products->fields['products_price'])."円";
				$sql_attributes = "select * from orders_products_attributes  where orders_id=".$order_HLD."  and orders_products_id=".$result_HLD_products->fields['orders_products_id'];
				$result_HLD_products_attributes = $db_HLD->Execute($sql_attributes);
				while (!$result_HLD_products_attributes->EOF) {
					$str = $str."(".$result_HLD_products_attributes->fields['products_options_values']."+".floor($result_HLD_products_attributes->fields['options_values_price'])."円)";
					$result_HLD_products_attributes->MoveNext();	
				}
				$str = $str.";<br>";
				$result_HLD_products->MoveNext();	
		}
		echo "***************************************<br>".$str."***************************************<br>";
		$taskContent = $str;
		$taskLevel = 1;
		$sql = "INSERT INTO tasks (content,level,status) VALUES ('$taskContent','$taskLevel',1)";
		$db->Execute($sql);		
	}else{
		echo "***************************************<br>没这个订单ID：".$order_H."<br>***************************************<br>";
	}


}else if($doFlag == "order_HL"){
	//加订单 Lucklaser	
	$order_HL = $_POST["order_HL"];
	$sql = "select * from orders where orders_id=".$order_HL;
	$result_HL = $db_HL->Execute($sql);	
	if(!$result_HL->EOF){
		$str = "HL";
		$str = $str.$result_HL->fields['orders_id'];	
		$str = $str.', ';
		$str = $str.$result_HL->fields['customers_name'];	
		$str = $str."<br>";
		$sql = "select * from orders_products where orders_id=".$order_HL;
		$result_HL_products = $db_HL->Execute($sql);
		while (!$result_HL_products->EOF) {
				$str = $str.$result_HL_products->fields['products_quantity']." x ".$result_HL_products->fields['products_name']."    ". floor($result_HL_products->fields['products_price'])."$";
				$sql_attributes = "select * from orders_products_attributes  where orders_id=".$order_HL."  and orders_products_id=".$result_HL_products->fields['orders_products_id'];
				$result_HL_products_attributes = $db_HL->Execute($sql_attributes);
				while (!$result_HL_products_attributes->EOF) {
					$str = $str."(".$result_HL_products_attributes->fields['products_options_values']."+".floor($result_HL_products_attributes->fields['options_values_price'])."$)";
					$result_HL_products_attributes->MoveNext();	
				}
				$str = $str.";<br>";
				$result_HL_products->MoveNext();	
		}
		echo "***************************************<br>".$str."***************************************<br>";
		$taskContent = $str;
		$taskLevel = 1;
		$sql = "INSERT INTO tasks (content,level,status) VALUES ('$taskContent','$taskLevel',1)";
		$db->Execute($sql);
	}else{
		echo "***************************************<br>没这个订单ID：".$order_HL."<br>***************************************<br>";
	}
}else if($doFlag == "order_HK"){
	//加订单 Kennbikyou	
	$order_HK = $_POST["order_HK"];
	$sql = "select * from orders where orders_id=".$order_HK;
	$result_HK = $db_HK->Execute($sql);	
	if(!$result_HK->EOF){
		$str = "HK";
		$str = $str.$result_HK->fields['orders_id'];	
		$str = $str.', ';
		$str = $str.$result_HK->fields['customers_name'];	
		$str = $str."<br>";
		$sql = "select * from orders_products where orders_id=".$order_HK;
		$result_HK_products = $db_HK->Execute($sql);
		while (!$result_HK_products->EOF) {	
				$str = $str.$result_HK_products->fields['products_quantity']." x ".$result_HK_products->fields['products_name']."    ". floor($result_HK_products->fields['products_price'])."円";
				$sql_attributes = "select * from orders_products_attributes  where orders_id=".$order_HK."  and orders_products_id=".$result_HK_products->fields['orders_products_id'];
				$result_HK_products_attributes = $db_HK->Execute($sql_attributes);
				while (!$result_HK_products_attributes->EOF) {
					$str = $str."(".$result_HK_products_attributes->fields['products_options_values']."+".floor($result_HK_products_attributes->fields['options_values_price'])."円)";
					$result_HK_products_attributes->MoveNext();	
				}
				$str = $str.";<br>";
				$result_HK_products->MoveNext();	
		}
		echo "***************************************<br>".$str."***************************************<br>";
		$taskContent = $str;
		$taskLevel = 1;
		$sql = "INSERT INTO tasks (content,level,status) VALUES ('$taskContent','$taskLevel',1)";
		$db->Execute($sql);
	}else{
		echo "***************************************<br>没这个订单ID：".$order_HK."<br>***************************************<br>";
	}
}else if($doFlag == "order_HD"){
	//加订单 Dmicroscope	
	$order_HD = $_POST["order_HD"];
	$sql = "select * from orders where orders_id=".$order_HD;
	$result_HD = $db_HD->Execute($sql);	
	if(!$result_HD->EOF){
		$str = "HD";
		$str = $str.$result_HD->fields['orders_id'];	
		$str = $str.', ';
		$str = $str.$result_HD->fields['customers_name'];	
		$str = $str."<br>";
		$sql = "select * from orders_products where orders_id=".$order_HD;
		$result_HD_products = $db_HD->Execute($sql);
		while (!$result_HD_products->EOF) {
				$str = $str.$result_HD_products->fields['products_quantity']." x ".$result_HD_products->fields['products_name']."    ". floor($result_HD_products->fields['products_price'])."$";
				$sql_attributes = "select * from orders_products_attributes  where orders_id=".$order_HD."  and orders_products_id=".$result_HD_products->fields['orders_products_id'];
				$result_HD_products_attributes = $db_HD->Execute($sql_attributes);
				while (!$result_HD_products_attributes->EOF) {
					$str = $str."(".$result_HD_products_attributes->fields['products_options_values']."+".floor($result_HD_products_attributes->fields['options_values_price'])."$)";
					$result_HD_products_attributes->MoveNext();	
				}
				$str = $str.";<br>";
				$result_HD_products->MoveNext();
		}
		echo "***************************************<br>".$str."***************************************<br>";
		$taskContent = $str;
		$taskLevel = 1;
		$sql = "INSERT INTO tasks (content,level,status) VALUES ('$taskContent','$taskLevel',1)";
		$db->Execute($sql);
	}else{
		echo "***************************************<br>没这个订单ID：".$order_HD."<br>***************************************<br>";
	}
}else if($doFlag == "order_HS"){
	//加订单 Spycamhidden	
	$order_HS = $_POST["order_HS"];
	$sql = "select * from orders where orders_id=".$order_HS;
	$result_HS = $db_HS->Execute($sql);	
	if(!$result_HS->EOF){
		$str = "HS";
		$str = $str.$result_HS->fields['orders_id'];	
		$str = $str.', ';
		$str = $str.$result_HS->fields['customers_name'];	
		$str = $str."<br>";
		$sql = "select * from orders_products where orders_id=".$order_HS;
		$result_HS_products = $db_HS->Execute($sql);
		while (!$result_HS_products->EOF) {
				//$str = $str.$result_HS_products->fields['products_quantity']." x ".$result_HS_products->fields['products_name']."<br>";
				//$result_HS_products->MoveNext();	
				$str = $str.$result_HS_products->fields['products_quantity']." x ".$result_HS_products->fields['products_name']."    ". floor($result_HS_products->fields['products_price'])."$";
				$sql_attributes = "select * from orders_products_attributes  where orders_id=".$order_HS."  and orders_products_id=".$result_HS_products->fields['orders_products_id'];
				$result_HS_products_attributes = $db_HS->Execute($sql_attributes);
				while (!$result_HS_products_attributes->EOF) {
					$str = $str."(".$result_HS_products_attributes->fields['products_options_values']."+".floor($result_HS_products_attributes->fields['options_values_price'])."$)";
					$result_HS_products_attributes->MoveNext();	
				}
				$str = $str.";<br>";
				$result_HS_products->MoveNext();
		}
		echo "***************************************<br>".$str."***************************************<br>";
		$taskContent = $str;
		$taskLevel = 1;
		$sql = "INSERT INTO tasks (content,level,status) VALUES ('$taskContent','$taskLevel',1)";
		$db->Execute($sql);
	}else{
		echo "***************************************<br>没这个订单ID：".$order_HS."<br>***************************************<br>";
	}
}

//显示任务列表列表
$sql = "SELECT * from tasks t where t.status=1 and t.level!=4 order by modifytime desc ";
if($doFlag == "toList"){
	$statusFlag = $_POST["statusFlag"];
	if($statusFlag == 1){ //当前任务
		$sql = "SELECT * from tasks t where t.status=1 and t.level!=4 order by modifytime desc ";
	}else if($statusFlag == 2){//(不用了)已完成
		$sql = "SELECT * from tasks t where t.status=2 order by modifytime desc ";
	}else if($statusFlag == 3){//历史任务
	   $sql = "SELECT * from tasks_history t  order by t.modifytime desc ";
	}else if($statusFlag == 4){//任务整理  
		
		$sql_select = "SELECT * from tasks t where t.status!=1 order by modifytime desc ";
		$result = $db->Execute($sql_select);
		while (!$result->EOF) {
			$id_tmp = $result->fields['id'];
			$content_tmp = $result->fields['content'];
			$level_tmp = $result->fields['level'];
			$status_tmp = $result->fields['status'];
			$modifytime_tmp = $result->fields['modifytime'];
			$sql_insert = "INSERT INTO tasks_history (taskes_id,content,level,status,modifytime) VALUES ($id_tmp,'$content_tmp',$level_tmp,$status_tmp,'$modifytime_tmp')";			
			$db->Execute($sql_insert);
			$sql_delete = "DELETE  from tasks  where id=$id_tmp";			
			$db->Execute($sql_delete);
			

			$sql_taskprocess = "SELECT * from taskprocess t where t.task_id=$id_tmp";
			$result_taskprocess = $db->Execute($sql_taskprocess);
			while (!$result_taskprocess->EOF) {
				$task_id_tmp = $result_taskprocess->fields['task_id'];
				$task_process_tmp = $result_taskprocess->fields['task_process'];
				$modifytime_tmp = $result_taskprocess->fields['modifytime'];
				$sql_insert = "INSERT INTO taskprocess_history (task_id,task_process,modifytime) VALUES ($task_id_tmp,'$task_process_tmp','$modifytime_tmp')";			
				$db->Execute($sql_insert);
				$result_taskprocess->MoveNext();
			}
			$sql_delete = "DELETE  from taskprocess  where task_id=$id_tmp";	
			$db->Execute($sql_delete);

			$result->MoveNext();
		}
		$sql = "SELECT * from tasks t where t.status=1 order by modifytime desc ";
   }else if($statusFlag == 5){//退换跟踪
		$sql = "SELECT * from tasks t where t.status=1 and t.level=4  order by modifytime desc ";
	}else{ 
		$sql = "SELECT * from tasks t where t.status=1 order by modifytime desc ";
	}
	
}


/**
新加退换跟踪后,显示退换跟踪列表
**/
if($doFlag == "addTask"){
	//新加任务
	$taskLevel = $_POST["taskLevel"];
	if( $taskLevel == 4){
		$sql = "SELECT * from tasks t where t.status=1 and t.level=4  order by modifytime desc ";
	}
}



$result = $db->Execute($sql);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<!--Begin:head-->
<?php include("head.php"); ?>
<!--End:head-->


<body>
<form name="listForm" action="index.php" method="post">
<div id="container" >	

<div id="newTask">
<div class="leftDiv">
New Task:<br>
<textarea name="taskContent" id="taskContent" rows=3 cols=50></textarea><br>
等级：
<select name="taskLevel" id="taskLevel">
<option value=1>重要</option>
<option value=2 selected>普通</option>
<option value=3>不急</option>
<option value=4>退换</option>
</select>
<br>
<span style="margin-left:300px;"><input type="button" value="新加任务" onclick="addTask()"></span>
</div>


<div class="leftDiv left2">
<table>
<tr>
<td>Hiteclaser:</td>
<td><input type="text" name="order_H" id="order_H" size=3 ></td>
<td><input type="button" value="加订单(H)" onclick="addOrder_H()">	
</td>
<td>
	<input type="button" value="Reviews(H)" onclick="addReviews_H()">
</td>		
</tr>



<tr>
<td>Laser-door:</td>
<td><input type="text" name="order_HLD" id="order_HLD" size=3 ></td>
<td><input type="button" value="加订单(HLD)" onclick="addOrder_HLD()">	
</td>
<td>
	<input type="button" value="Reviews(HLD)" onclick="addReviews_HLD()">
</td>		
</tr>

<tr>
<td>Lucklaser:</td>
<td><input type="text" name="order_HL" id="order_HL" size=3 ></td>
<td><input type="button" value="加订单(HL)" onclick="addOrder_HL()">
</td>
<td>
	<input type="button" value="Reviews(HL)" onclick="addReviews_HL()">
</td>	
</tr>


<tr>
<td>Kennbikyou:</td>
<td><input type="text" name="order_HK" id="order_HK"  size=3 ></td>
<td><input type="button" value="加订单(HK)" onclick="addOrder_HK()">
</td>
<td>
	<input type="button" value="Reviews(HK)" onclick="addReviews_HK()">
</td>	
</tr>

<tr>
<td>DMicroscope:</td>
<td><input type="text" name="order_HD" id="order_HD" size=3 ></td>
<td><input type="button" value="加订单(HD)" onclick="addOrder_HD()">
</td>
<td>
	<input type="button" value="Reviews(HD)" onclick="addReviews_HD()">
</td>	
</tr>


<tr>
<td>Spycamhidden:</td>
<td><input type="text" name="order_HS" id="order_HS" size=3 ></td>
<td><input type="button" value="加订单(HS)" onclick="addOrder_HS()">
</td>
<td>
	<input type="button" value="Reviews(HS)" onclick="addReviews_HS()">
</td>	
</tr>

</table>




</div>

</div>

<div class="clearBoth">&nbsp;</div>


<div class="grayTable">
<caption>To do list:
<a href="javascript:toList(1)">当前任务</a>
<!--<a href="javascript:toList(2)">已完成</a>-->
<!--<a href="javascript:toList(0)">所有</a>-->
<a href="javascript:toList(3)">历史任务</a>
<a href="javascript:toList(4)">清理任务</a>
<a href="javascript:toList(5)">退换跟踪</a>
</caption><br>
<table >

<thead>
	<tr>
		<th scope="col" width=70>时间</th>
	    <th scope="col" >任务</th>
		<th scope="col" >进展</th>
		<th scope="col" width=95>操作</th>
	</tr>
</thead>
<tbody>

	
	
<?php
	while (!$result->EOF) {
		//取当前任务的进展描述
		if($statusFlag == 3){//历史任务
			$sql = "SELECT * from taskprocess_history where task_id=".$result->fields['taskes_id']." order by modifytime asc";
		}else{
			$sql = "SELECT * from taskprocess where task_id=".$result->fields['id']." order by modifytime asc";
		}		
		$resultProcess = $db->Execute($sql);
		$currentProcess = "";
		while (!$resultProcess->EOF) {
			$task_processField = $resultProcess->fields['task_process'];
			if(strlen($task_processField)>50){
				$task_processField = substr($task_processField,0,50)."...";
			}
			$currentProcess = $currentProcess.$resultProcess->fields['modifytime']."&nbsp;&nbsp;".$task_processField."<br>";
			$resultProcess->MoveNext();	
		}
		
				
		
		$task_contentField = $result->fields['content'];			
		//控制任务长度 <300
		/*
		if(strlen($task_contentField)>300){				
				$task_contentField = substr($task_contentField,0,300)."...";
		}
		*/
		

		if($result->fields['level'] == 1){
			$strTR = "<tr class='important'>"; //重要任务
		}else{
			$strTR = "<tr >";
		}		
		$strTR = $strTR."<td width=70>".$result->fields['modifytime']."</td>"."<td  >".$task_contentField."</td>";
		$strTR = $strTR."<td>".$currentProcess."<input type='text' size=30 name='process_".$result->fields['id']."' id='process_".$result->fields['id']."'><input type='button' value='提交' onclick='addProcess(".$result->fields['id'].")'></td>";
		if($result->fields['status'] == 1){
			$strTR = $strTR."<td width=95><input type='button' value='完成' onclick='doComplete(".$result->fields['id'].")'><input type='button' value='删除' onclick='doDelete(".$result->fields['id'].")'></td>";
		}else if($result->fields['status'] == 2){
			$strTR = $strTR."<td>已完成</td>";
		}else if($result->fields['status'] == 3){
			$strTR = $strTR."<td>已删除</td>";
		}
		
		$strTR = $strTR."</tr>";
		echo $strTR;
		$result->MoveNext();	
	}
?>




</tbody>
</table>
</div><!--end:grayTable -->

</div><!--end:container -->



<input type="hidden" name="doFlag" id="doFlag" >
<input type="hidden" name="statusFlag" id="statusFlag" >
<input type="hidden" name="taskId" id="taskId" >
</form>
	
	
<form name="reviewsForm" action="reviews.php" method="post">
<input type="hidden" name="currentSite" id="currentSite" >
</form>
			
<br><br><br><br>
</body>




</html>

<script>
<?php
$doFlag = $_POST["doFlag"];




if($doFlag == "addProcess"){
	$taskId = $_POST["taskId"];
	echo "$('#process_".$taskId."').focus(); "; 
}else{
	echo "$('#taskContent').focus(); "; 
}
?>

//$("#taskContent").focus();  

function addTask(){
	var taskContent = $("#taskContent").val();	
	if(taskContent==""){
		alert("任务内容不能为空");
		$("#taskContent").focus();  
		return;
	}else{
		document.getElementById('doFlag').value = "addTask";
		document.listForm.submit();
	}
}

function toList(status){
	if(status == 4){ //清理任务
		if(confirm("[说明]清理任务:是把标记为'已完成','已删除'的记录转移到历史表中,是否继续?")){ 
		}else{
			return;
		}		
	}
	document.getElementById('doFlag').value = "toList";
	document.getElementById('statusFlag').value = status;
	document.listForm.submit();
}


function addProcess(id){
	document.getElementById('doFlag').value = "addProcess";
	document.getElementById('taskId').value = id;
	var processStr = document.getElementById('process_'+id).value;
	if(processStr == ""){
		alert("进展内容不能为空")
		document.getElementById('process_'+id).focus();  
		return;
	}
	document.listForm.submit();
}

function doComplete(id){
	document.getElementById('doFlag').value = "doComplete";
	document.getElementById('taskId').value = id;
	document.listForm.submit();
}

function doEdit(id){
	document.getElementById('doFlag').value = "doEdit";
	document.getElementById('taskId').value = id;
	document.listForm.submit();
}

function doDelete(id){
	document.getElementById('doFlag').value = "doDelete";
	document.getElementById('taskId').value = id;
	document.listForm.submit();
}


//+++++++++++++加订单+++++++++++++++++++++++++++++++	
function  addOrder_H(){
	var orderId = $("#order_H").val();	
	if(orderId==""){
		alert("ID不能为空");
		$("#order_H").focus();  
		return;
	}else{
		document.getElementById('doFlag').value = "order_H";
		document.listForm.submit();
	}
}



function  addOrder_HLD(){
	var orderId = $("#order_HLD").val();	
	if(orderId==""){
		alert("ID不能为空");
		$("#order_HLD").focus();  
		return;
	}else{
		document.getElementById('doFlag').value = "order_HLD";
		document.listForm.submit();
	}
}


function  addOrder_HL(){
	var orderId = $("#order_HL").val();	
	if(orderId==""){
		alert("ID不能为空");
		$("#order_HL").focus();  
		return;
	}else{
		document.getElementById('doFlag').value = "order_HL";
		document.listForm.submit();
	}
}


function  addOrder_HK(){
	var orderId = $("#order_HK").val();	
	if(orderId==""){
		alert("ID不能为空");
		$("#order_HK").focus();  
		return;
	}else{
		document.getElementById('doFlag').value = "order_HK";
		document.listForm.submit();
	}
}


function  addOrder_HD(){
	var orderId = $("#order_HD").val();	
	if(orderId==""){
		alert("ID不能为空");
		$("#order_HD").focus();  
		return;
	}else{
		document.getElementById('doFlag').value = "order_HD";
		document.listForm.submit();
	}
}

function  addOrder_HS(){
	var orderId = $("#order_HS").val();	
	if(orderId==""){
		alert("ID不能为空");
		$("#order_HS").focus();  
		return;
	}else{
		document.getElementById('doFlag').value = "order_HS";
		document.listForm.submit();
	}
}
	
//+++++++++++++++加Reviews+++++++++++++++++++++++++++++
function  addReviews_H(){
	document.getElementById('currentSite').value = "H";
	document.reviewsForm.submit();
}	

function  addReviews_HLD(){
	document.getElementById('currentSite').value = "HLD";
	document.reviewsForm.submit();
}

function  addReviews_HL(){
	document.getElementById('currentSite').value = "HL";
	document.reviewsForm.submit();
}
		
function  addReviews_HK(){
	document.getElementById('currentSite').value = "HK";
	document.reviewsForm.submit();
}
	
function  addReviews_HD(){
	document.getElementById('currentSite').value = "HD";
	document.reviewsForm.submit();
}
	
function  addReviews_HS(){
	document.getElementById('currentSite').value = "HS";
	document.reviewsForm.submit();
}
</script>

